home *** CD-ROM | disk | FTP | other *** search
- How to launch NewsFind from another application
- ===============================================
-
- NewsFind can be called from another application. In this mode it will
- not install an icon on the icon bar and will exit when it has finished
- one search. You can choose whether to pass a search specification or to
- leave it to the user to enter the details in NewsFind's dialogue box.
- Either way it multitasks, so you should launch it in the following way:
-
- Call Wimp_StartTask to run it with a Control file as a parameter
- and store the task handle returned by the SWI.
-
- Wait until you receive Message_TaskCloseDown (&400C3) from the
- task, then read the results files.
-
- The Control file should be the first parameter in the command used to
- launch NewsFind eg:
-
- Run <NewsFind$Dir>.!Run <NewsFind$WorkDir>.NewsFind.Control
-
- Note that if you use <NewsFind$WorkDir> at this point, its NewsFind
- subdirectory may not have been created yet, so you should create it first
- as a precaution with a line such as:
-
- _swix(OS_File, _INR(0,1)|_IN(4), 8, "<NewsFind$WorkDir>.NewsFind", 0);
-
- NewsFind will automatically do this for any other files it may want to
- store there.
-
- There are two results files you can specify in the Control file. I
- recommend that you specify <NewsFind$WorkDir>.NewsFind.Result and
- <NewsFind$WorkDir>.NewsFind.Found. You should ensure that old copies of
- these files do not exist before starting a search, otherwise your
- application could read invalid results from an earlier search if NewsFind
- aborts. The first is the Result file, which will contain a single line
- showing the number of matching messages found in textual form. The second
- is the Found description file, which will contain details of each matching
- file in the form of one line per group, starting with the group name,
- followed by a space-separated (including a trailing space for each line)
- list of all matching articles in the group. All searched groups will be
- listed, even if they contain no matches. For example, a typical search of
- comp.sys.acorn.* I performed earlier produced this:
-
- comp.sys.acorn.announce
- comp.sys.acorn.games 975 976 1111 1147 1148 1154
- comp.sys.acorn.hardware
- comp.sys.acorn.misc 4244 4245 4458 4475 4576 4681
- comp.sys.acorn.programmer 1304 1305 1306 1307 1336 1337 1340 1359 1409 1410 1411 1412 1413 1446 1447 1490 1491 1492 1493 1499 1562 1563
-
- Control file format
- ___________________
-
- The Control file takes the form of a Messages file with the following
- tags:
-
- User
- ----
- User to use for performing the search.
- Optional, defaulting to root.
-
- Password
- --------
- Password for above user.
- Optional, defaulting to no password.
-
- Log
- ---
- Number indicating type of log. 8=none, 9=appended to existing log,
- 10=overwrites any existing log.
- Optional, defaulting to 9.
-
- LogFile
- -------
- File to write log to.
- Optional, defaulting to <NewsFind$WorkDir>.NewsFind.Log
-
- ResultFile
- ----------
- Result file, as described above.
- Optional, defaulting to none.
-
- FoundFile
- ---------
- Found file, as described above.
- Optional, defaulting to none.
-
- Copy
- ----
- Whether to copy matching articles to a folder (see FoundFolder).
- Y or N.
- Optional, defaulting to Y.
-
- FoundFolder
- -----------
- A Newsbase folder to copy any matching articles to (see Copy).
- Optional, defaulting to Folder.NewsFind.
-
- XPos
- ----
- YPos
- ----
- OS coords for where to position top left of search dialogue box if used.
- If both are 0, the position defined in the Res file is used.
- Optional, defaulting to 0.
-
- Status
- ------
- Whether to open Status window.
- Y or N.
- Optional, defaulting to Y.
-
- StatusX
- -------
- StatusY
- -------
- Position of Status window (see XPos, YPos).
-
- Expression
- ----------
- Search expression as defined in !Help file.
- If present, the Search dialogue will not be used.
- Optional, defaulting to use dialogue box instead.
-
- Group
- -----
- Group specifier as defined in !Help file.
- Compulsory if Expression is present, otherwise optional.
-
- Scope
- -----
- Which part of each article to search
- 0 = Subject
- 1 = From
- 2 = Date
- 3 = MessageID
- 4 = References
- 256 = Whole article
- 257 = Body only
- 258 = All headers
- Compulsory if Expression is present, otherwise optional.
-
- Case
- ----
- Whether search is case-sensitive.
- Y or N.
- Optional, defaulting to N.
-
- Strict
- ------
- Whether search is a strict line match.
- Optional, defaulting to N.
-
- Reverse
- -------
- Whether to search backwards so that newest items are searched first.
- Y or N.
- Optional, defaulting to N.
-
- Delete
- ------
- Whether to delete matching articles.
- Y or N.
- Optional, defaulting to N.
-